package com.skd.mall.product.controller.web;


import com.skd.mall.product.entity.SkuImagesEntity;
import com.skd.mall.product.entity.SkuInfoEntity;
import com.skd.mall.product.entity.SpuInfoDescEntity;
import com.skd.mall.product.service.*;
import com.skd.mall.product.vo.ItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.concurrent.ExecutionException;

@Controller
public class ItemController {

    @Autowired
    private SkuInfoService skuInfoService;

    @RequestMapping("/{skuId}.html")
    public String item(@PathVariable Long skuId, Model model) throws ExecutionException, InterruptedException {
        ItemVO itemVO = skuInfoService.getItemVOBySkuId(skuId);
        model.addAttribute("item",itemVO);
        return "item";
    }
}
